<?php
declare (strict_types = 1);

namespace app\validate;

use think\Validate;

class User extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */	
	protected $rule = [
        'user_name'  => 'require|max:30',
        'user_sex'   => 'require',
        'email' => 'email',
    ];
    
    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */	
    protected $message = [
        'user_name.require' => '名称必须填写',
        'user_name.max'     => '名称最多不能超过30个字符',
        'user_sex.require' => '性别必须填写',
        'email'        => '邮箱格式错误',
    ];
}
